package com.sfzy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sfzy.entity.PsychKnow;
import com.sfzy.mapper.PsychKnowMapper;
import com.sfzy.service.PsychKnowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName PsychKnowServiceImpl
 * @Description TODO
 * @Author niejiacan
 * @Date 2025年08月14日 10:46
 * @Version 1.0
 */
@Service
public class PsychKnowServiceImpl implements PsychKnowService {
    @Autowired
    private PsychKnowMapper psychKnowMapper;


    @Override
    public int addPsychKnow(PsychKnow psychKnow) {
        return psychKnowMapper.addPsychKnow(psychKnow);
    }

    @Override
    public int updatePsychKnow(PsychKnow psychKnow) {
        return psychKnowMapper.updatePsychKnow(psychKnow);
    }

    @Override
    public int deletePsychKnow(int id) {
        return psychKnowMapper.deletePsychKnow(id);
    }

    @Override
    public PsychKnow selectPsychKnow(int id) {
        return psychKnowMapper.selectPsychKnow(id);
    }

    @Override
    public PageInfo<PsychKnow> pageNameContent(PsychKnow psychKnow, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<PsychKnow> psychKnows = psychKnowMapper.pageNameContent(psychKnow);
        PageInfo<PsychKnow> info = new PageInfo<>(psychKnows);
        return info;
    }
}
